<div class="search-box" {if mocod()=='index.main'} style="margin-left: 10px;margin-top: 10px; +margin-top: 18px;float:left" {/if} >
<input type="text" id="search-txt"  value="{$kw}" placeholder="搜索您需要的商品"  class="input_h search-box__input"  onkeyup="if (event.keyCode == 13) front_search_request();" {if mocod()=='index.main'} style="width: 400px;" {/if}/>
<input class="search-box__button" type="button" value="搜索" onclick="front_search_request()" />
</div>
<script type="text/javascript">
var front_search_base = "{echo logic('url')->create('search', array('mod'=>'search','kw' => 'xqw'))}";
function front_search_request()
{
window.location = front_search_base.replace('xqw', encodeURIComponent($('#search-txt').val()));
}
</script>
<div style="display: none;">搜索框</div>